Introduction

How do music vibes relate to the lyrics? It is tempting to think that music tries to convey some feeling or emotion, and that both the music and lyrics are there to support this message. Let me give you an example. We might expect a song with a slow beat and laid back guitar to talk about laid back topics, maybe a trip to the beach. At the other end of the spectrum, heavy metal would likely concern itself with darker, heavier subjects. However, are these suspicions even true? Let’s put some numbers to the hypothesis that there in fact is a relationship between music and lyrics. In the next sections I’ll take you through a journey where we approach this topic through a scientific lens, harnessing all the powers that modern technology has to offer along the way.

Before we delve any deeper, we should define which specific areas we will be researching.

Because it’s hard to objectively define such a subjective subject as ‘vibes’, we will restrict the ‘vibes’ to be studied to three distinct ‘vibes’: happy, sad, and neutral. Though per song these classifications probably will differ per person to some degree, generally in western culture there is consensus as to what they mean. Of course, there are many more nuanced emotions, but they are a lot more subjective.

Furthermore, if we roughly break down music into four main elements, we get melody, harmony, instrumentation and rhythm. We will investigate each separately, and in the end combined.

Let us dive into it!

Corpus

Before we go, we still need to settle on a body of music to let our analyses loose upon. To avoid lyrical variation between genres, and to reasonably limit the scope of this project, we will stick to the pop genre only. That is, the top-100 songs of the last decade.

Using the API that Musixmatch offers, I’ll load the lyrics from all tracks in the corpus. Then using the NLTK package, which offers natural language processing functionalities, the lyrics for each track are assigned a ‘semantic’ score, i.e. positive, negative, or neutral. We use this as an indicator if the text is more on the ‘happy’ or ‘sad’ end of the spectrum. In the next sections we’ll be analyzing the corpus musically using the Spotify API, and comparing it to the lyrical analysis.

Discovery


The Spotify API offers functionalities that range from very high to very low level. Here we will use some the the high level analyses to learn about the corpus.

Melody

Harmony

Instrumentation

Rhythm

Note!

I’m redesigning my entire project to fit my research question, as I’m getting the hang of all the R functionalities. This means I’m currently retailoring all previous homework assignments!